<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>a标签</title>
		
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
</head>
<body>
	<div id="div"></div>


<script type="text/javascript">
	for(var i=0; i<10; i++){
		var a = $('<a>');
		a.html(i+"<br>");
		a.on('click',function(){
			alert($(this).text());
		})
		$('#div').append(a);
	}
</script> 
</body>
</html>
